package com.gome.wechat.program.service.impl;

import com.gome.wechat.program.dao.UserRepo;
import com.gome.wechat.program.entity.User;
import com.gome.wechat.program.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by liwei113 on 2017/10/20 0020.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepo userRepo;


    @Override
    public User save(User user) {
        return userRepo.save(user);
    }

    @Override
    public User findByOpenId(String openId) {
        return userRepo.findByOpenId(openId);
    }

    @Override
    public User findById(Long id) {
        return userRepo.findOne(id);
    }

    @Override
    public List<User> findByUserIdIn(List<Long> ids) {
        return userRepo.findByIdIn(ids);
    }
}
